<div class="content-wrapper" style="min-height: 976px;">

    <div class="pad margin no-print" ng-if="hasFund == false">
        <div class="callout callout-info" style="margin-bottom: 0!important;">
            <h4><i class="fa fa-info"></i> 提示:</h4>
            您还没有创建自己的基金，请点击<a ui-sref="index.fund.add"><strong> 创建基金 </strong></a>进行创建
        </div>
    </div>

    <section class="content" ng-if="hasFund == true" ng-repeat="fund in fundList">
        <div class="box box-primary">
            <!--<div class="box-header">-->
                <!--<h3 class="box-title">基金</h3>-->
            <!--</div>-->

            <div class="box-body" style="padding-left: 10px;padding-right: 10px">
                <div class="row">
                    <div class="col-xs-12">
                        <h2 class="page-header">
                            <i class="fa fa-globe"></i> {{fund.name}}
                            <small class="pull-right">  {{fund.createDate}} </small>
                        </h2>
                    </div>
                    <!-- /.col -->
                </div>

                <div class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">名称</label>
                        <div class="col-sm-8">
                            <input class="form-control" placeholder="基金名称" value="{{fund.name}}" readonly>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">股份</label>
                        <div class="col-sm-8">
                            <input class="form-control" placeholder="基金原始股" value="{{fund.initialShares}}" readonly>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">现金</label>
                        <div class="col-sm-8">
                            <input class="form-control" placeholder="现金" value="$ {{fund.cash}}" readonly>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">NAV</label>
                        <div class="col-sm-8">
                            <input class="form-control" placeholder="NAV" value="$ {{fund.netAssetValue}}" readonly>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">NAVPS</label>
                        <div class="col-sm-8">
                            <input class="form-control" placeholder="NAV" value="$ {{fund.netAssetValuePerShare}}" readonly>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">操作到期时间</label>
                        <div class="col-sm-8">
                            <input class="form-control" placeholder="操作到期时间" value="{{fund.operatingPeriod}}" readonly>
                        </div>
                    </div>
                </div>

                <div class="col-sm-8 col-md-offset-2">
                    <table class="table table-striped">
                        <tbody>
                        <tr>
                            <th style="width: 10px">#</th>
                            <th style="width: 160px">相关股票</th>
                            <th style="width: 160px;">最新价格</th>
                            <th style="width: 160px">涨跌价格</th>
                            <th style="width: 160px">涨跌幅</th>
                            <th style="width: 160px">交易数量</th>
                            <th style="width: 160px">持有数量</th>
                        </tr>

                        <tr ng-repeat="fundstock in fund.fundStocks" ng-if="fundstock.stockQuantity > 0">
                            <td>{{$index + 1}}</td>
                            <td>{{fundstock.stock.name}}</td>
                            <td>
                                <div class="">
                                    <strong>$ </strong>{{fundstock.stock.price}}
                                </div>
                            </td>
                            <td>
                                <div class="">
                                    <span ng-if="fundstock.stock.changeRange > 0" class="badge bg-green"><strong>$ +</strong>{{fundstock.stock.changePrice}}</span>
                                    <span ng-if="fundstock.stock.changeRange <= 0" class="badge bg-red"><strong>$ </strong>{{fundstock.stock.changePrice}}</span>

                                </div>
                            </td>
                            <td>
                                <span ng-if="fundstock.stock.changeRange > 0" class="badge bg-green">+{{fundstock.stock.changeRange}} %</span>
                                <span ng-if="fundstock.stock.changeRange <= 0" class="badge bg-red">{{fundstock.stock.changeRange}} %</span>
                            </td>
                            <td>{{fundstock.stock.remainQuantity}}</td>
                            <td>{{fundstock.stockQuantity}}</td>
                        </tr>
                        </tbody></table>
                </div>

            </div>

            <div class="box-footer">
                <button class="btn btn-info pull-right" ui-sref="index.fund.edit({fundUid: fund.uid})">修改</button>
            </div>
        </div>
    </section>

    <div class="pad margin no-print" ng-if="hasFund == true">
        <div class="callout callout-info" style="margin-bottom: 0!important;">
            <h4><i class="fa fa-info"></i> 提示:</h4>
            点击<a ui-sref="index.fund.add"><strong> 创建基金 </strong></a>创建更多基金
        </div>
    </div>
</div>